package com.syni.mdd.sjb.common.datatreaure.controller.protect;


import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckUserIdentity;
import com.syni.mdd.sjb.common.datatreaure.controller.BaseController;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.successExample.ExampleByIdVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.successExample.ExampleVo;
import com.syni.mdd.sjb.common.datatreaure.service.DxshAppSuccessExampleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 成功案例记录表 前端控制器
 * </p>
 *
 * @author cfx
 * @since 2020-04-23
 */
@RestController
@RequestMapping("/successExample")
public class DxshAppSuccessExampleController extends BaseController {

    @Autowired
    DxshAppSuccessExampleService dxshAppSuccessExampleService;

    @PostMapping("/example")
    @ApiOperation(value = "获取成功案例列表")
    @CheckUserIdentity
    public Map<String,Object> example(@RequestBody @Validated ExampleVo exampleVo){
        return dxshAppSuccessExampleService.example(exampleVo);
    }

    @PostMapping("/exampleById")
    @ApiOperation(value = "获取成功案例详情")
    @CheckUserIdentity
    public Map<String,Object> exampleById(@RequestBody @Validated ExampleByIdVo exampleByIdVo){
        return dxshAppSuccessExampleService.exampleById(exampleByIdVo);
    }
}
